import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
import '../controller.dart';

class HomePageViewBottom extends StatefulWidget {
  HomepageController pageController;

  HomePageViewBottom({required this.pageController, super.key});

  @override
  State<HomePageViewBottom> createState() => _HomePageViewBottomState();
}

class _HomePageViewBottomState extends State<HomePageViewBottom> {
  @override
  Widget build(BuildContext context) {
    return widget.pageController.pageList.isNotEmpty
        ? Container(
            padding: const EdgeInsets.only(top: 5).r,
            alignment: Alignment.center,
            child: SmoothPageIndicator(
              controller: widget.pageController.deviceCategoryPageController,
              count: widget.pageController.pageList.length,
              axisDirection: Axis.horizontal,
              effect: WormEffect(
                  type: WormType.normal,
                  spacing: 8.0.r,
                  radius: 2.0.r,
                  dotWidth: 4.0.r,
                  dotHeight: 4.0.r,
                  paintStyle: PaintingStyle.fill,
                  dotColor: const Color.fromRGBO(255, 255, 255, 0.2),
                  activeDotColor: Colors.white),
            ),
          )
        : Container();
  }
}
